package com.aizuda.boot.modules.business.negotiation.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 合同协商节点实例实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "contract_negotiation_node_instance", autoResultMap = true)
@Schema( description = "合同协商节点实例表")
public class ContractNegotiationNodeInstanceEntity {
    
    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "协商实例ID")
    private Integer instanceId;

    @Schema(description = "角色ID")
    private Integer roleId;

    @Schema(description = "节点名称")
    private String nodeName;

    @Schema(description = "节点状态（processing、completed、rejected）")
    private String status;

    @Schema(description = "是否为当前节点（0=否，1=是）")
    private Boolean isCurrentNode;

    @Schema(description = "节点开始时间")
    private LocalDateTime startTime;

    @Schema(description = "节点完成时间")
    private LocalDateTime finishTime;

    @Schema(description = "转办后当前处理人ID")
    private Long transferUserId;

    @Schema(description = "被转办的原处理人ID")
    private Long originalUserId;

    @Schema(description = "邀请规则类型（department_role, approval_matrix）")
    private String inviteRuleType;

    @Schema(description = "邀请规则配置快照")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private String ruleConfigSnapshot;

    @Schema(description = "关联的审批任务ID")
    private Long taskId;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;

    @Schema(description = "节点排序号，用于控制协商节点的顺序")
    private Integer sortOrder;
} 